package com.ruoyi.domain;

import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 手机端商户信息对象 mobil_merchant
 *
 * @author ruoyi
 * @date 2025-01-20
 */
public class MobilMerchant extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键id */
    private Integer id;

    /** 店铺名 */
    @Excel(name = "店铺名")
    private String name;

    /** 经营区域 */
    @Excel(name = "经营区域")
    private String operatingArea;

    /** 注册时间 */
    @Excel(name = "注册时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date regTime;

    /** 开始营业时间 */
    @Excel(name = "开始营业时间", width = 30, dateFormat = "HH:mm:ss")
    private String startTime;

    /** 停止营业时间 */
    @Excel(name = "停止营业时间", width = 30, dateFormat = "HH:mm:ss")
    private String endTime;

    /** 详细地址 */
    @Excel(name = "详细地址")
    private String address;

    /** 经度 */
    @Excel(name = "经度")
    private String longitude;

    /** 纬度 */
    @Excel(name = "纬度")
    private String latitude;

    /** 商家介绍 */
    @Excel(name = "商家介绍")
    private String description;

    /** 商家评分 */
    @Excel(name = "商家评分")
    private Double rate;

    /** 经营状态（0正常、1放假） */
    @Excel(name = "经营状态", readConverterExp = "0=正常,1=放假")
    private Integer status;

    /** 删除状态 */
    private Integer deleted;

    /** 审核状态(0待审核、1已审核、2已拒绝) */
    @Excel(name = "审核状态", readConverterExp = "0=待审核,1=已审核,2=已拒绝")
    private Integer auditStatusId;

    /** 当前金额 */
    @Excel(name = "当前金额")
    private Double currentBalance;

    /** 距离（前端计算字段，不存储在数据库） */
    private String distance;

    /** 预估时间（前端计算字段，不存储在数据库） */
    private String time;

    /** 商户图片列表 */
    private List<String> images;

    /** 服务项目列表 */
    private List<MobilServiceDetails> services;

    /** 月销量 */
    private Integer monthlySales;

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setOperatingArea(String operatingArea) {
        this.operatingArea = operatingArea;
    }

    public String getOperatingArea() {
        return operatingArea;
    }

    public void setRegTime(Date regTime) {
        this.regTime = regTime;
    }

    public Date getRegTime() {
        return regTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAddress() {
        return address;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    public Double getRate() {
        return rate;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setAuditStatusId(Integer auditStatusId) {
        this.auditStatusId = auditStatusId;
    }

    public Integer getAuditStatusId() {
        return auditStatusId;
    }

    public void setCurrentBalance(Double currentBalance) {
        this.currentBalance = currentBalance;
    }

    public Double getCurrentBalance() {
        return currentBalance;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public List<String> getImages() {
        return images;
    }

    public void setImages(List<String> images) {
        this.images = images;
    }

    public List<MobilServiceDetails> getServices() {
        return services;
    }

    public void setServices(List<MobilServiceDetails> services) {
        this.services = services;
    }

    public Integer getMonthlySales() {
        return monthlySales;
    }

    public void setMonthlySales(Integer monthlySales) {
        this.monthlySales = monthlySales;
    }

    /**
     * 获取营业时间字符串
     */
    public String getBusinessHours() {
        if (startTime != null && endTime != null) {
            return String.format("周一至周日 %s-%s", startTime, endTime);
        }
        return "营业时间未设置";
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("operatingArea", getOperatingArea())
                .append("regTime", getRegTime())
                .append("startTime", getStartTime())
                .append("endTime", getEndTime())
                .append("address", getAddress())
                .append("longitude", getLongitude())
                .append("latitude", getLatitude())
                .append("description", getDescription())
                .append("rate", getRate())
                .append("status", getStatus())
                .append("deleted", getDeleted())
                .append("auditStatusId", getAuditStatusId())
                .append("currentBalance", getCurrentBalance())
                .toString();
    }
}

